<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>	
<%
	String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>



<!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
       <!-- Sidebar Menu -->
      <ul class="sidebar-menu" data-widget="tree">
      	<li class="header">HEADER</li>
      	<c:forEach items="${nav.menus}" var="menu" >
      		<c:url var='menuURL' value='${menu.url}'>
      			<c:param name="menuId" value="${menu.id}" />
      		</c:url>      		
      		<c:choose>
      			<c:when test="${menu.hasChildren() == false}">
      				<c:choose>
      					<c:when test="${menu.isAcitve()}">
      						<li class="active"><a href="${menuURL}"><i class="${menu.iconCss}"></i> <span>${menu.text}</span></a></li>
      					</c:when>
      					<c:otherwise>
      						<li><a href="${menuURL}"><i class="${menu.iconCss}"></i> <span>${menu.text}</span></a></li>
      					</c:otherwise>
      				</c:choose>
      			</c:when>      			
      			<c:otherwise> <!-- 进入这里表示有子菜单 -->
      				<c:choose>
      					<c:when test="${menu.isAcitve()}">
	      					<li class="treeview menu-open active">					         
      					</c:when>
      					<c:otherwise>
      						<li class="treeview">
      					</c:otherwise>
      				</c:choose>
		      					 <a href="#"><i class="${menu.iconCss}"></i> <span>${menu.text}</span>
							            <span class="pull-right-container">
							                <i class="fa fa-angle-left pull-right"></i>
							              </span>
							     </a>					          
						          <ul class="treeview-menu">
						          	<c:forEach items="${menu.items}" var="item">
						          		<c:url var='itemURL' value='${item.url}'>
						          			<c:param name="menuId" value="${item.id}" />
						          		</c:url>
						          		<c:choose>
						          			<c:when test="${item.isAcitve()}">
						          				<li class="active"><a href="${itemURL}"><i class="${item.iconCss}"></i>${item.text}</a></li>
						          			</c:when>
						          			<c:otherwise>
							          			<li><a href="${itemURL}"><i class="${item.iconCss}"></i>${item.text}</a></li>	
							          		</c:otherwise>
						          		</c:choose>							          		
						          	</c:forEach>					            
						          </ul>
							</li>      				
      			</c:otherwise>
      		</c:choose>
      	</c:forEach>               
      
    </section>
    <!-- /.sidebar -->
  </aside>